package com.explorex.infra.puma.gateway.netty.ws;

import com.explorex.infra.puma.gateway.netty.ws.handler.HttpServerHandler;
import lombok.Getter;
import lombok.Setter;
import org.springframework.context.ApplicationContext;

/**
 * @author: JacceYang
 * @createTime: 2022/07/14 7:42 下午
 * @description: Websocket server for websocket protocal, port 5444
 */
public class WebSocketServer extends HttpServer {

    @Setter
    @Getter
    private WebSocketEvent webSocketEvent;

    @Setter
    @Getter
    private static ApplicationContext context;
    @Setter
    private String webSocketPath;

    @Override
    protected void processHttpHandler(HttpServerHandler httpServerHandler) {
        if (httpServerHandler != null) {
            httpServerHandler.setWebSocketPath(webSocketPath);
            httpServerHandler.setWebSocketEvent(webSocketEvent);
        }
    }
}
